{extend name="base" /}
{block name="content"}
<div class="g-main">
    <div class="m-main-title">
        <div class="m-container-fluid">
            <a href="{:url('index/welcome')}"><i class="icon icon-home"></i>首页</a>
            <span class="icon-angle-right"></span>
            <span>系统</span>
            <span class="icon-angle-right"></span>
            <span>公告管理</span>
            <span class="icon-angle-right"></span>
            <span>{$info ? '编辑' : '添加'}公告</span>
            <a class="u-flush"><i class="icon-repeat"></i></a>
        </div>
    </div>
    <div class="m-main-content">
        <div class="m-container">
            <div class="m-form">
                <form class="layui-form" id="j_form">
                    <table class="m-table">
                        <thead>
                        <tr>
                            <th colspan="2">{$info ? '编辑' : '添加'}公告</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td width="15%"><label for="title">标题<em>*</em></label></td>
                            <td><input type="text" class="u-ipt u-ipt-long" name="title" id="title" placeholder="请输入平台消息标题" value="{$info.title}" /></td>

                        <tr>
                            <td width="15%"><label for="title">首页推荐<em>*</em></label></td>
                            <!--                            <td><input type="password" class="u-ipt u-ipt-long" name="password" id="password" placeholder="请输入密码" value="" /></td>-->
                            <td>
                                <input type="radio" name="recommend" value="1" title="是"{if condition="$info['recommend'] eq 1"} checked{/if}/>
                                <input type="radio" name="recommend" value="0" title="否"{if condition="$info['recommend'] eq 0"} checked{/if}/>

                                <!--                            <input type="radio" name="db[is_wx_subscribe]" value="0" title="已开启" />-->
                            </td>
                        </tr>

                        <tr>
                            <td><label for="">封面图片</label></td>
                            <td>
                                <button type="button" class="layui-btn u-upload-pic" data-name="img_url"><i class="layui-icon">&#xe67c;</i>上传图片</button>
                                <div class="m-pic">
                                    <ul>
                                        {:attach_html($info.img_url, 'img_url')}
                                    </ul>
                                </div>
                            </td>
                        </tr>
                        </tr>
                        <tr>
                            <td><label for="goods_intro">描述</label></td>
                            <td><div class="m-textarea"><textarea name="describe" class="u-tarea" id="describe" placeholder="描述">{$info.describe}</textarea></div></td>
                        </tr>
                        <tr>
                            <td width="15%"><label for="describe">内容</label></td>
                            <td> <textarea name="content" id="content" style="width:100%;height:300px;" >{$info.content}</textarea></td>
                        </tr>
                        </tbody>
                    </table>
                    <div class="m-form-btn"><input type="hidden" name="id" value="{$info.id}"><button id="j_btn" class="u-btn">确定提交</button></div>
                </form>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="extrajs"}
{include file="public:upload"/}
{include file="public:editor"/}
<script>
    UE.getEditor('content');
</script>
{/block}